package com.jeeplus.test.jlnu.graduationInfo.mapper;

import com.jeeplus.test.jlnu.graduationInfo.domain.entity.GraduationInfoFile;
import com.jeeplus.test.jlnu.graduationInfo.domain.vo.GraduationInfoReqVo;
import com.jeeplus.test.jlnu.graduationInfo.domain.vo.NewGraduationInfoReqVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface GraduationInfoFileMapper {
    @Select("SELECT id, info_id AS infoId, certificate_name AS certificateName, certificate_file AS certificateFile, " +
            "certificate_type AS certificateType, stamp_sign AS stampSign, approve_state AS approveState, " +
            "approve_remark AS approveRemark " +
            "FROM jlnu_graduation_info_file " +
            "WHERE info_id = #{infoId}")
    @Results({
            @Result(property = "id", column = "id"),
            @Result(property = "infoId", column = "info_id"),
            @Result(property = "certificateName", column = "certificate_name"),
            @Result(property = "certificateFile", column = "certificate_file"),
            @Result(property = "certificateType", column = "certificate_type"),
            @Result(property = "stampSign", column = "stamp_sign"),
            @Result(property = "approveState", column = "approve_state"),
            @Result(property = "approveRemark", column = "approve_remark")
    })
    List<GraduationInfoFile> findByInfoId(@Param("infoId") Long infoId);
    void insertGraduationInfoFile(@Param("graduationInfoFile")List<GraduationInfoFile> graduationInfoFiles);

    List<GraduationInfoFile> findByCertificateNameList(@Param("certificateNames") List<String> certificateNames);
    List<NewGraduationInfoReqVo> findByCertificateNos(List<String> certificateNos);
    void updateGraduationInfoFile (@Param("graduationInfoFile")GraduationInfoFile graduationInfoFiles);
    void updateFileStatus(List<Long> ids);
    void updatefileByInfoId(List<Long> ids);

    void rejectFile(NewGraduationInfoReqVo newGraduationInfoReqVo);
    void rejectByInfoId(NewGraduationInfoReqVo newGraduationInfoReqVo);
    List<GraduationInfoFile> findListByInfoIds(List<Long> infoIds);
}
